package cn.gnp.framework.core.util;


import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class ReflectUtil {

	/**
	 * @param args
	 */
	
	public static Field[] getClassFields(String className)
	{
		Field[] fields = null;
		Class clazz;
		try {
			clazz = Class.forName(className);
			Object obj = (Object)clazz.newInstance();
			fields = obj.getClass().getDeclaredFields();			
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}			
		return fields;
	}
	
	public static Method[] getClassMethods(String className)
	{
		Method[] methods = null;
		Class clazz;
		try {
			clazz = Class.forName(className);
			Object obj = (Object)clazz.newInstance();
			methods = obj.getClass().getDeclaredMethods();			
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}			
		return methods;
	}	
}